package com.test.config;

import com.test.pojo.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration//代表这是一个配置类
@ComponentScan("com.test.pojo")
@Import(Config2.class)
public class Config {
    @Bean//通过方法注册一个bean，这里的返回值就Bean的类型，方法名就是bean的id！
    public User user(){
        return new User();
    }
}
